<template>
  <div class="w100 xczxfsdtert display-flex">
    <div class="xczxcfrtery">
      <n-menu
        :collapsed-width="64"
        :collapsed-icon-size="22"
        :options="menuOptions"
        :default-value="currentRoute.name"
        default-value="jbxin"
      />
    </div>
    <div class="flex-1 pd pt10 pm10">
      <div class="xxcxzcerewtt h100">
        <router-view> </router-view>
      </div>
    </div>
  </div>
</template>
<script lang="ts" setup>
import { ref, h } from "vue";
import xxinfobj from "./xxinfobj.vue";
import kecheng from "./kecheng.vue";
import { useRouter } from "vue-router";
import { hf, dxget } from "../../../util/index.ts";
const { currentRoute } = useRouter();
const kxzcxder = ref(1);
localStorage.Userid = "88887745";
const menuOptions = ref([
  {
    key: "cxxinfobj",
    label: () => {
      return h(
        "div",
        {
          onClick: () => {
            hf("cxxinfobj");
          },
        },
        "系统首页"
      );
    },
  },
  {
    key: "cjsgl",
    label: () => {
      return h(
        "div",
        {
          onClick: () => {
            hf("cjsgl");
          },
        },
        "教师管理"
      );
    },
  },
  {
    label: "班级管理",
    key: "bjguli",
    children: [],
  },
  {
    label: "校内管理",
    key: "xngl",
    children: [
      {
        key: "xnglkecheng",
        label: () => {
          return h(
            "div",
            {
              onClick: () => {
                hf("xnglkecheng");
              },
            },
            "课程管理"
          );
        },
      },
      {
        key: "xnbmList",
        label: () => {
          return h(
            "div",
            {
              onClick: () => {
                hf("xnbmList");
              },
            },
            "报名列表"
          );
        },
      },
    ],
  },
  {
    label: "校外管理",
    key: "xiaowai",
    children: [
      {
        key: "ckecheng",
        label: () => {
          return h(
            "div",
            {
              onClick: () => {
                hf("ckecheng");
              },
            },
            "课程管理"
          );
        },
      },
      {
        key: "kwbmlb",
        label: () => {
          return h(
            "div",
            {
              onClick: () => {
                hf("kwbmlb");
              },
            },
            "报名列表"
          );
        },
      },
    ],
  },
  {
    key: "cxsgl",
    label: () => {
      return h(
        "div",
        {
          onClick: () => {
            hf("cxsgl");
          },
        },
        "学生管理"
      );
    },
  },
  {
    key: "bill",
    label: () => {
      return h(
        "div",
        {
          onClick: () => {
            hf("bill");
          },
        },
        "账单管理"
      );
    },
  },
]);

const xtgxxmfl = async () => {
  const { data }: any = await dxget("dxgjAdmin/getzd/getzdJsList?ids=316");
  data[0].map((a) => {
    menuOptions.value[2].children.push({
      key: "banjikey" + a.value,
      label: () => {
        return h(
          "div",
          {
            onClick: () => {
              hf("cbanji", { nianjiid: a.value });
            },
          },
          a.label
        );
      },
    });
  });
};

xtgxxmfl();
</script>
<style scoped>
.xczxfsdtert {
  height: 100vh;
  background: #f8f8f8;
}
.xczxcfrtery {
  width: 175px;
  background: #181818;
}
</style>
